recursive function

recursive function
  1. рекурсивная функция

 

рекурсивная функция
Функция, которая в своем определении содержит обращение к самой себе.
В математике и информатике рекурсивной называют такую функцию или процедуру, которая при своей работе обращается к себе самой, прямо или косвенно. Соответственно говорят о прямой и косвенной рекурсии. При прямой рекурсии процедура содержит вызов себя в своем собственном теле, например:
ЭТО прямая....
ЕСЛИ ... ТО прямая
....
КОНЕЦ
Косвенная рекурсия образуется цепочкой процедур, и эта цепочка замыкает себя в рекурсивное кольцо, например:
ЭТО процедура0
....
... процедура1
....
КОНЕЦ
ЭТО процедура1
....
... процедура2
....
КОНЕЦ
ЭТО процедура2
....
... процедура0
....
КОНЕЦ
В примере цепочка "процедура0--процедура1--процедура2--процедура0" образует косвенную рекурсию. "Процедура0" является рекурсивной, так как вызывает сама себя. Правда, этот вызов не прямой, а косвенный, через обращение к процедурам "процедура1" и "процедура2". Понятно, что каждая из процедур рекурсивной цепочки (и "процедура 1", и "процедура2") тоже являются рекурсивными.
Прямая рекурсия всегда предпочтительнее косвенной не в смысле эффективности выполнения, а в смысле наглядности записи. Читателю программы проследить косвенную рекурсию сложнее.
Сама по себе косвенная рекурсия не содержит новых идей. Это просто другая форма записи прямой рекурсии, если, конечно, промежуточные процедуры не содержат других дополнительных рекурсий.
Рекурсия это не GOTO (переход на начало процедуры). Рекурсивный вызов - это выполнение КОПИИ процедуры: он может порождать "отложенные" команды, которые начнут выполняться после завершения рекурсии. И будут выполняться столько раз, сколько было рекурсивных вызовов. (из статей А.А. Дуванова).
Пример рекурсии:
У попа была собака,
Он ее любил.
Она съела кусок мяса,
Он ее убил.
И в ямку закопал,
И надпись написал:
У попа была собака...
[http://www.morepc.ru/dict/]

Тематики

  • информационные технологии в целом

EN

  • recursive function


Англо-русский словарь нормативно-технической терминологии. . 2015.

Игры ⚽ Нужно сделать НИР?

Полезное


Смотреть что такое "recursive function" в других словарях:

  • Recursive function — may refer to: Recursion (computer science), a procedure or subroutine, implemented in a programming language, whose implementation references itself A total computable function, a function which is defined for all possible inputs See also μ… …   Wikipedia

  • recursive function — ▪ mathematics       in logic and mathematics, a type of function or expression predicating some concept or property of one or more variables, which is specified by a procedure that yields values or instances of that function by repeatedly… …   Universalium

  • recursive function — noun a) Any function whose value may be obtained using a finite number of operations using a precisely specified algorithm b) Any function that uses recursion and can call itself until a certain condition is met …   Wiktionary

  • Primitive recursive function — The primitive recursive functions are defined using primitive recursion and composition as central operations and are a strict subset of the recursive functions (recursive functions are also known as computable functions). The term was coined by… …   Wikipedia

  • Μ-recursive function — In mathematical logic and computer science, the μ recursive functions are a class of partial functions from natural numbers to natural numbers which are computable in an intuitive sense. In fact, in computability theory it is shown that the μ… …   Wikipedia

  • μ-recursive function — In mathematical logic and computer science, the μ recursive functions are a class of partial functions from natural numbers to natural numbers which are computable in an intuitive sense. In fact, in computability theory it is shown that the μ… …   Wikipedia

  • Non-recursive function — might refer to: Recursion (computer science): a procedure or subroutine, implemented in a programming language, whose implementation references itself μ recursive function, defined from a particular formal model of computable functions using… …   Wikipedia

  • Recursive — may refer to:*Recursion *Recursively enumerable language *Recursively enumerable set *Recursive filter *Recursive function *Recursive language *Recursive acronym *Recursive set *Primitive recursive function …   Wikipedia

  • Recursive set — In computability theory, a set of natural numbers is called recursive, computable or decidable if there is an algorithm which terminates after a finite amount of time and correctly decides whether or not a given number belongs to the set. A more… …   Wikipedia

  • recursive — A procedure that is applied once, and then applied to the result of that application, and so on. A recursive definition (definition by induction) defines the result of some operation for 0, and then the result for any number n + 1 in terms of the …   Philosophy dictionary

  • Function (mathematics) — f(x) redirects here. For the band, see f(x) (band). Graph of example function, In mathematics, a function associates one quantity, the a …   Wikipedia


Поделиться ссылкой на выделенное

Прямая ссылка:
Нажмите правой клавишей мыши и выберите «Копировать ссылку»